home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / AMScen_0_9.lha / AMScen / streets.m < prev    next >
Text File  |  1995-01-21  |  26KB  |  761 lines

  1. /*
  2.  * Amiga MUD
  3.  *
  4.  * Copyright (c) 1995 by Chris Gray
  5.  */
  6.  
  7. /*
  8.  * streets.m - define the outside streets in the starter dungeon.
  9.  */
  10.  
  11. private tp_streets CreateTable().
  12. use tp_streets
  13.  
  14. define tp_streets STREETS_ID NextEffectId().
  15.  
  16. define tp_streets proc drawStreets()void:
  17.  
  18.     if not KnowsEffect(nil, STREETS_ID) then
  19.     DefineEffect(nil, STREETS_ID);
  20.     GSetImage(nil, "town_streets");
  21.     IfFound(nil);
  22.         GShowImage(nil, "", 0, 0, 160, 100, 0, 0);
  23.     Else(nil);
  24.         GSetPen(nil, C_DARK_GREY);
  25.         GAMove(nil, 0, 0);
  26.         GRectangle(nil, 159, 99, true);
  27.  
  28.         GSetPen(nil, C_LIGHT_GREY);
  29.         GAMove(nil, 0, 0);
  30.         GRectangle(nil, 69, 41, true);
  31.         GAMove(nil, 89, 0);
  32.         GRectangle(nil, 70, 41, true);
  33.         GAMove(nil, 0, 57);
  34.         GRectangle(nil, 69, 42, true);
  35.         GAMove(nil, 89, 57);
  36.         GRectangle(nil, 70, 42, true);
  37.  
  38.         GSetPen(nil, C_DARK_BROWN);
  39.         GAMove(nil, 0, 0);
  40.         GRectangle(nil, 62, 35, true);
  41.         GAMove(nil, 96, 0);
  42.         GRectangle(nil, 63, 35, true);
  43.         GAMove(nil, 0, 63);
  44.         GRectangle(nil, 62, 36, true);
  45.  
  46.         GSetPen(nil, C_WHITE);
  47.         GAMove(nil, 79, 0);
  48.         GRDraw(nil, 0, 35);
  49.         GAMove(nil, 0, 49);
  50.         GRDraw(nil, 62, 0);
  51.         GAMove(nil, 97, 49);
  52.         GRDraw(nil, 62, 0);
  53.         GAMove(nil, 79, 63);
  54.         GRDraw(nil, 0, 36);
  55.  
  56.         GSetPen(nil, C_BLACK);
  57.         GAMove(nil, 62, 13);
  58.         VerticalDoor();
  59.         GAMove(nil, 96, 1);
  60.         VerticalDoor();
  61.         GAMove(nil, 96, 13);
  62.         VerticalDoor();
  63.         GAMove(nil, 96, 25);
  64.         VerticalDoor();
  65.         GAMove(nil, 101, 35);
  66.         HorizontalDoor();
  67.         GAMove(nil, 122, 35);
  68.         HorizontalDoor();
  69.         GAMove(nil, 143, 35);
  70.         HorizontalDoor();
  71.         GAMove(nil, 62, 65);
  72.         VerticalDoor();
  73.         GAMove(nil, 62, 77);
  74.         VerticalDoor();
  75.         GAMove(nil, 62, 89);
  76.         VerticalDoor();
  77.         GAMove(nil, 5, 63);
  78.         HorizontalDoor();
  79.         GAMove(nil, 26, 63);
  80.         HorizontalDoor();
  81.         GAMove(nil, 47, 63);
  82.         HorizontalDoor();
  83.  
  84.         GSetPen(nil, C_LIGHT_GREEN);
  85.         GAMove(nil, 96, 63);
  86.         GRectangle(nil, 56, 30, true);
  87.         GSetPen(nil, C_LIGHT_GREY);
  88.         GAMove(nil, 121, 63);
  89.         GRectangle(nil, 5, 36, true);
  90.         GAMove(nil, 111, 69);
  91.         GRectangle(nil, 25, 18, true);
  92.         GSetPen(nil, C_BLUE);
  93.         GAMove(nil, 118, 74);
  94.         GRectangle(nil, 11, 8, true);
  95.         GSetPen(nil, C_GOLD);
  96.         GAMove(nil, 123, 78);
  97.         GCircle(nil, 1, true);
  98.         GAMove(nil, 124, 78);
  99.         GCircle(nil, 1, true);
  100.  
  101.         GSetPen(nil, C_DARK_BROWN);
  102.         GAMove(nil, 103, 72);
  103.         GRectangle(nil, 7, 12, true);
  104.         GAMove(nil, 137, 72);
  105.         GRectangle(nil, 8, 12, true);
  106.         GSetPen(nil, C_BLACK);
  107.         GAMove(nil, 110, 74);
  108.         VerticalDoor();
  109.         GAMove(nil, 137, 74);
  110.         VerticalDoor();
  111.  
  112.         GSetPen(nil, C_FOREST_GREEN);
  113.         GAMove(nil, 100, 67);
  114.         GCircle(nil, 5, true);
  115.         GAMove(nil, 135, 67);
  116.         GCircle(nil, 4, true);
  117.         GAMove(nil, 145, 68);
  118.         GCircle(nil, 5, true);
  119.         GAMove(nil, 114, 91);
  120.         GCircle(nil, 3, true);
  121.         GAMove(nil, 107, 90);
  122.         GCircle(nil, 3, true);
  123.         GAMove(nil, 99, 91);
  124.         GCircle(nil, 3, true);
  125.         GAMove(nil, 149, 80);
  126.         GCircle(nil, 3, true);
  127.         GAMove(nil, 148, 87);
  128.         GCircle(nil, 3, true);
  129.         GAMove(nil, 142, 91);
  130.         GCircle(nil, 3, true);
  131.         GAMove(nil, 133, 90);
  132.         GCircle(nil, 3, true);
  133.     Fi(nil);
  134.     EndEffect();
  135.     fi;
  136.     CallEffect(nil, STREETS_ID);
  137. corp;
  138.  
  139. define tp_streets STREETS_MAP_GROUP NextMapGroup().
  140.  
  141. define tp_streets proc streetPos(thing room; int x, y)void:
  142.  
  143.     RoomGraphics(room, "Street", "", STREETS_MAP_GROUP, x, y, drawStreets);
  144. corp;
  145.  
  146. define tp_streets proc makeStreet(thing parent; int x, y)thing:
  147.     thing newStreet;
  148.  
  149.     newStreet := CreateThing(parent);
  150.     newStreet@p_rContents := CreateThingList();
  151.     SetThingStatus(newStreet, ts_readonly);
  152.     streetPos(newStreet, x, y);
  153.     newStreet
  154. corp;
  155.  
  156. define tp_streets proc makeStreetP(thing parent; int x, y)thing:
  157.     thing newStreet;
  158.  
  159.     newStreet := CreateThing(parent);
  160.     newStreet@p_rContents := CreateThingList();
  161.     SetThingStatus(newStreet, ts_public);
  162.     streetPos(newStreet, x, y);
  163.     newStreet
  164. corp;
  165.  
  166. define tp_streets proc makePark(string name, desc; int x, y)thing:
  167.     thing newPark;
  168.  
  169.     newPark := CreateThing(r_park);
  170.     newPark@p_rName := name;
  171.     if desc ~= "" then
  172.     newPark@p_rDesc := desc;
  173.     fi;
  174.     newPark@p_rContents := CreateThingList();
  175.     SetThingStatus(newPark, ts_readonly);
  176.     RoomGraphics(newPark, "Park", "", STREETS_MAP_GROUP, x, y, drawStreets);
  177.     newPark
  178. corp;
  179.  
  180. define tp_streets proc makeParkP(string name, desc; int x, y)thing:
  181.     thing newPark;
  182.  
  183.     newPark := CreateThing(r_park);
  184.     newPark@p_rName := name;
  185.     if desc ~= "" then
  186.     newPark@p_rDesc := desc;
  187.     fi;
  188.     newPark@p_rContents := CreateThingList();
  189.     SetThingStatus(newPark, ts_public);
  190.     RoomGraphics(newPark, "Park", "", STREETS_MAP_GROUP, x, y, drawStreets);
  191.     newPark
  192. corp;
  193.  
  194. define tp_streets proc makeDingy(string name, desc; int x, y)thing:
  195.     thing newDingy;
  196.  
  197.     newDingy := CreateThing(r_park);
  198.     newDingy@p_rName := name;
  199.     if desc ~= "" then
  200.     newDingy@p_rDesc := desc;
  201.     fi;
  202.     newDingy@p_rContents := CreateThingList();
  203.     SetThingStatus(newDingy, ts_public);
  204.     RoomGraphics(newDingy, "Dingy", "Sidewalk", STREETS_MAP_GROUP, x, y,
  205.          drawStreets);
  206.     newDingy
  207. corp;
  208.  
  209. define tp_streets r_crossNE CreateThing(r_sidewalk).
  210. SetupRoom(r_crossNE, "on the north-east corner of the main intersection",
  211.     "Handy sidewalks head north and east, and you can cross the streets "
  212.     "to the south and west.").
  213. streetPos(r_crossNE, 89, 35).
  214.  
  215. define tp_streets r_crossNW CreateThing(r_sidewalk).
  216. SetupRoom(r_crossNW, "on the north-west corner of the main intersection",
  217.     "Handy sidewalks head north and west, and you can cross the streets "
  218.     "to the south and east.").
  219. streetPos(r_crossNW, 63, 35).
  220.  
  221. define tp_streets r_crossSE CreateThing(r_sidewalk).
  222. SetupRoom(r_crossSE, "on the south-east corner of the main intersection",
  223.     "Handy sidewalks head south and east alongside the park, and you can "
  224.     "cross the streets to the north and west.").
  225. streetPos(r_crossSE, 89, 57).
  226.  
  227. /* put r_crossSW in tp_misc, since is needed in machines.m */
  228. define tp_misc r_crossSW CreateThing(r_sidewalk).
  229. SetupRoom(r_crossSW, "on the south-west corner of the main intersection",
  230.     "Handy sidewalks head south and west, and you can cross the streets "
  231.     "to the north and east.").
  232. streetPos(r_crossSW, 63, 57).
  233.  
  234. Connect(r_crossNE, r_crossNW, D_WEST).
  235. Connect(r_crossNE, r_crossSE, D_SOUTH).
  236. Connect(r_crossSW, r_crossSE, D_EAST).
  237. Connect(r_crossSW, r_crossNW, D_NORTH).
  238.  
  239. define tp_streets r_nw CreateThing(r_sidewalk).
  240. SetThingStatus(r_nw, ts_readonly).
  241. r_nw@p_rName := "on the west sidewalk, north of the main intersection".
  242. define tp_streets r_nw1 makeStreet(r_nw, 63, 26).
  243. Connect(r_crossNW, r_nw1, D_NORTH).
  244. define tp_streets r_nw2 makeStreet(r_nw, 63, 14).
  245. Connect(r_nw1, r_nw2, D_NORTH).
  246. define tp_streets r_nw3 makeStreet(r_nw, 63, 2).
  247. r_nw3@p_rDesc := "You can cross the street to the east.".
  248. Connect(r_nw2, r_nw3, D_NORTH).
  249. define tp_streets r_ne CreateThing(r_sidewalk).
  250. SetThingStatus(r_ne, ts_readonly).
  251. r_ne@p_rName := "on the east sidewalk, north of the main intersection".
  252. define t_streets r_ne1 makeStreetP(r_ne, 89, 26).
  253. Connect(r_crossNE, r_ne1, D_NORTH).
  254. define t_streets r_ne2 makeStreetP(r_ne, 89, 14).
  255. Connect(r_ne1, r_ne2, D_NORTH).
  256. define t_streets r_ne3 makeStreetP(r_ne, 89, 2).
  257. r_ne3@p_rDesc := "You can cross the street to the west.".
  258. Connect(r_ne2, r_ne3, D_NORTH).
  259. Connect(r_nw3, r_ne3, D_EAST).
  260.  
  261. define tp_streets r_en CreateThing(r_sidewalk).
  262. SetThingStatus(r_en, ts_readonly).
  263. r_en@p_rName := "on the north sidewalk, east of the main intersection".
  264. define t_streets r_en1 makeStreetP(r_en, 103, 35).
  265. Connect(r_crossNE, r_en1, D_EAST).
  266. define t_streets r_en2 makeStreetP(r_en, 124, 35).
  267. Connect(r_en1, r_en2, D_EAST).
  268. define t_streets r_en3 makeStreetP(r_en, 145, 35).
  269. Connect(r_en2, r_en3, D_EAST).
  270. r_en3@p_rDesc := "You can cross the street to the south.".
  271. define tp_streets r_es CreateThing(r_sidewalk).
  272. SetThingStatus(r_es, ts_readonly).
  273. r_es@p_rName := "on the south sidewalk, east of the main intersection".
  274. r_es@p_rDesc := "The rail fence around the park is to your south.".
  275. Scenery(r_es, "fence;rail.railing,rail").
  276. define tp_streets r_es1 makeStreet(r_es, 104, 57).
  277. Connect(r_crossSE, r_es1, D_EAST).
  278. /* put r_es2 in tp_misc, since it is needed in machine.m */
  279. define tp_misc r_es2 makeStreet(r_es, 120, 57).
  280. r_es2@p_rDesc := "The north park entrance is to your south.".
  281. Connect(r_es1, r_es2, D_EAST).
  282. define tp_streets r_es3 makeStreet(r_es, 136, 57).
  283. Connect(r_es2, r_es3, D_EAST).
  284. define t_streets r_es4 makeStreetP(r_es, 153, 57).
  285. r_es4@p_rDesc :=
  286.     "You can cross the street to the north or go south alongside the park.".
  287. Connect(r_es3, r_es4, D_EAST).
  288. Connect(r_en3, r_es4, D_SOUTH).
  289.  
  290. define tp_streets r_wn CreateThing(r_sidewalk).
  291. SetThingStatus(r_wn, ts_readonly).
  292. r_wn@p_rName := "on the north sidewalk, west of the main intersection".
  293. define tp_streets r_wn1 makeStreet(r_wn, 49, 35).
  294. Connect(r_crossNW, r_wn1, D_WEST).
  295. define t_streets r_wn2 makeStreet(r_wn, 28, 35).
  296. Connect(r_wn1, r_wn2, D_WEST).
  297. define t_streets r_wn3 makeStreet(r_wn, 7, 35).
  298. r_wn3@p_rDesc := "You can cross the street to the south.".
  299. Connect(r_wn2, r_wn3, D_WEST).
  300. define tp_streets r_ws CreateThing(r_sidewalk).
  301. SetThingStatus(r_ws, ts_readonly).
  302. r_ws@p_rName := "on the south sidewalk, west of the main intersection".
  303. define t_streets r_ws1 makeStreetP(r_ws, 49, 57).
  304. Connect(r_crossSW, r_ws1, D_WEST).
  305. define t_streets r_ws2 makeStreetP(r_ws, 28, 57).
  306. Connect(r_ws1, r_ws2, D_WEST).
  307. define t_streets r_ws3 makeStreetP(r_ws, 7, 57).
  308. r_ws3@p_rDesc := "You can cross the street to the north.".
  309. Connect(r_ws2, r_ws3, D_WEST).
  310. Connect(r_wn3, r_ws3, D_SOUTH).
  311.  
  312. define tp_streets r_sw CreateThing(r_sidewalk).
  313. SetThingStatus(r_sw, ts_readonly).
  314. r_sw@p_rName := "on the west sidewalk, south of the main intersection".
  315. define tp_streets r_sw1 makeStreetP(r_sw, 63, 66).
  316. Connect(r_crossSW, r_sw1, D_SOUTH).
  317. /* r_sw2 is in tp_misc, since it is needed in bguild.m */
  318. define tp_misc r_sw2 makeStreet(r_sw, 63, 78).
  319. Connect(r_sw1, r_sw2, D_SOUTH).
  320. define t_streets r_sw3 makeStreetP(r_sw, 63, 90).
  321. r_sw3@p_rDesc := "You can cross the street to the east.".
  322. Connect(r_sw2, r_sw3, D_SOUTH).
  323. define tp_streets r_se CreateThing(r_sidewalk).
  324. SetThingStatus(r_se, ts_readonly).
  325. r_se@p_rName := "on the east sidewalk, south of the main intersection".
  326. r_se@p_rDesc := "The rail fence around the park is to your east.".
  327. Scenery(r_se, "fence;rail.railing,rail").
  328. define tp_streets r_se1 makeStreet(r_se, 89, 75).
  329. Connect(r_crossSE, r_se1, D_SOUTH).
  330. define t_streets r_se2 makeStreetP(r_se, 89, 92).
  331. r_se2@p_rDesc :=
  332.     "You can cross the street to the west or go east alongside the park.".
  333. Connect(r_se1, r_se2, D_SOUTH).
  334. Connect(r_sw3, r_se2, D_EAST).
  335.  
  336. define tp_streets r_parkNorth makePark("at the north entrance to the park",
  337.     "The street is to the north and park walks head east and west. Directly "
  338.     "south of you is the park's central fountain.", 120, 67).
  339. Connect(r_es2, r_parkNorth, D_SOUTH).
  340. define tp_streets o_fountainWater CreateThing(nil).
  341. FakeObject(o_fountainWater, r_parkNorth,
  342.     "water;central,fountain.fountain;water,in,from,the.mermaid;ugly,bronze",
  343.     "The fountain is a square hole in the sidewalk, filled with water. An "
  344.     "ugly bronze mermaid dribbles water into it. The water has a slightly "
  345.     "greenish tinge, and smells of too much chlorine.").
  346. o_fountainWater@p_oEatString :=
  347.     "Drink the water from that fountain? Ick! No way!".
  348. o_fountainWater@p_oTouchString :=
  349.     "You can't reach the bronze mermaid, "
  350.     "and the water is merely tepid and wet.".
  351. o_fountainWater@p_oSmellString := "You can smell the acrid tang of chlorine.".
  352. define tp_streets r_parkNorthEast makePark(
  353.     "at the northeast corner of the park walk", "", 130, 68).
  354. Connect(r_parkNorth, r_parkNorthEast, D_EAST).
  355. AddTail(r_parkNorthEast@p_rContents, o_fountainWater).
  356. define tp_streets r_parkNorthWest makePark(
  357.     "at the northwest corner of the park walk", "", 111, 68).
  358. Connect(r_parkNorth, r_parkNorthWest, D_WEST).
  359. AddTail(r_parkNorthWest@p_rContents, o_fountainWater).
  360. define tp_streets r_parkEast makeParkP("east of the fountain", "", 130, 75).
  361. Connect(r_parkNorthEast, r_parkEast, D_SOUTH).
  362. AddTail(r_parkEast@p_rContents, o_fountainWater).
  363. define tp_streets r_parkWest makeParkP("west of the fountain", "", 111, 75).
  364. Connect(r_parkNorthWest, r_parkWest, D_SOUTH).
  365. AddTail(r_parkWest@p_rContents, o_fountainWater).
  366. define tp_streets r_parkSouthEast makePark(
  367.     "at the southeast corner of the park walk", "", 130, 82).
  368. Connect(r_parkEast, r_parkSouthEast, D_SOUTH).
  369. AddTail(r_parkSouthEast@p_rContents, o_fountainWater).
  370. define tp_streets r_parkSouthWest makePark(
  371.     "at the southwest corner of the park walk", "", 111, 82).
  372. Connect(r_parkWest, r_parkSouthWest, D_SOUTH).
  373. AddTail(r_parkSouthWest@p_rContents, o_fountainWater).
  374. define tp_streets r_parkSouth makePark("at the south entrance to the park",
  375.     "A dingy sidewalk is to the south and park walks head east and west. "
  376.     "Directly north of you is the park's central fountain.", 120, 83).
  377. Connect(r_parkSouthEast, r_parkSouth, D_WEST).
  378. Connect(r_parkSouthWest, r_parkSouth, D_EAST).
  379. AddTail(r_parkSouth@p_rContents, o_fountainWater).
  380. define t_streets r_dingySouth makeDingy(
  381.     "on a dingy east-west sidewalk",
  382.     "The south park entrance is to your north", 120, 92).
  383. Connect(r_se2, r_dingySouth, D_EAST).
  384. Connect(r_parkSouth, r_dingySouth, D_SOUTH).
  385. define t_streets r_dingyCorner makeDingy(
  386.     "on a corner of dingy sidewalks",
  387.     "You can go north or west, both alongside the fenced-off park.", 153, 92).
  388. Connect(r_dingySouth, r_dingyCorner, D_EAST).
  389. Scenery(r_dingySouth, "park,fence,railing,rail;rail,fenced,off,fenced-off").
  390. define t_streets r_dingyEast makeDingy(
  391.     "on a dingy north-south sidewalk east of the park", "", 153, 76).
  392. Connect(r_dingyCorner, r_dingyEast, D_NORTH).
  393. Connect(r_es4, r_dingyEast, D_SOUTH).
  394.  
  395. /* connect the street to the minimall */
  396.  
  397. ExtendDesc(r_nw2,
  398.     "A passageway heads to the west. The walls and floor of the passageway "
  399.     "are of brown tile, with a simple pattern of white tiles thrown in. The "
  400.     "ceiling of the passageway is painted concrete, and fluorescent "
  401.     "striplights (half of which don't work at all) cast intermittant light on "
  402.     "the rubbish-strewn floor.").
  403. r_nw2@p_rWestDesc :=
  404.     "The passageway is fairly large, and is poorly lit. It is obviously well "
  405.     "used however. It is fairly long, but you can see a large open area at "
  406.     "the far end.".
  407. r_nw2@p_rWestMessage := "You head into the gloom of the passageway.".
  408. r_nw2@p_rWestOMessage := "heads into the passageway.".
  409. r_nw2@p_rWestEMessage := "comes out of the passageway.".
  410. r_nw2@p_rEnterDesc :=
  411.     "The passageway is fairly large, and is poorly lit. It is obviously well "
  412.     "used however. It is fairly long, but you can see a large open area at "
  413.     "the far end.".
  414. r_nw2@p_rEnterMessage := "You head into the gloom of the passageway.".
  415. r_nw2@p_rEnterOMessage := "heads into the passageway.".
  416. Connect(r_nw2, r_mallEntrance, D_WEST).
  417. Connect(r_nw2, r_mallEntrance, D_ENTER).
  418. Scenery(r_nw2,
  419.     "passageway,passage,floor,wall,ceiling;rubbish,strewn,rubbish-strewn."
  420.     "tile;brown,patterned."
  421.     "pattern;simple."
  422.     "concrete,painted."
  423.     "light,striplight;strip,fluorescent."
  424.     "rubbish").
  425.  
  426. /* Connect Questor's office to r_ws2 */
  427.  
  428. SetupQuestorOffice(r_ws2, D_SOUTH).
  429.  
  430. /* Build a ring road around the town. */
  431. /* I deliberately did not inherit from anything other than 'r_road' here,
  432.    to make it easier for others to modify the roads. */
  433.  
  434. define tp_streets TOWN_ROAD_NORTH_ID NextEffectId().
  435. define tp_streets proc drawRoadNorth()void:
  436.  
  437.     if not KnowsEffect(nil, TOWN_ROAD_NORTH_ID) then
  438.     DefineEffect(nil, TOWN_ROAD_NORTH_ID);
  439.     GSetImage(nil, "town_roadNorth");
  440.     IfFound(nil);
  441.         GShowImage(nil, "", 0, 0, 160, 100, 0, 0);
  442.     Else(nil);
  443.         GSetPen(nil, C_DARK_GREEN);
  444.         GAMove(nil, 0, 0);
  445.         GRectangle(nil, 159, 99, true);
  446.         GSetPen(nil, C_TAN);
  447.         GAMove(nil, 0, 38);
  448.         GRectangle(nil, 159, 24, true);
  449.         GAMove(nil, 65, 50);
  450.         GRectangle(nil, 30, 49, true);
  451.         GAMove(nil, 75, 0);
  452.         GRectangle(nil, 10, 50, true);
  453.     Fi(nil);
  454.     EndEffect();
  455.     fi;
  456.     CallEffect(nil, TOWN_ROAD_NORTH_ID);
  457. corp;
  458. define tp_streets r_roadNorth CreateThing(r_road).
  459. SetupRoomP(r_roadNorth, "at a junction",
  460.     "The town is to the south. A pathway leads to the north.").
  461. Connect(r_ne3, r_roadNorth, D_NORTH).
  462. UniConnect(r_nw3, r_roadNorth, D_NORTH).
  463. AutoGraphics(r_roadNorth, drawRoadNorth).
  464.  
  465. define t_streets r_roadNorthEast CreateThing(r_road).
  466. SetupRoomP(r_roadNorthEast, "at a corner in the road", "").
  467. Connect(r_roadNorth, r_roadNorthEast, D_EAST).
  468. AutoGraphics(r_roadNorthEast, AutoRoads).
  469.  
  470. define t_streets r_roadEast CreateThing(r_road).
  471. SetupRoomP(r_roadEast, "at a junction", "The town is to the west.").
  472. Connect(r_roadNorthEast, r_roadEast, D_SOUTH).
  473. Connect(r_es4, r_roadEast, D_EAST).
  474. UniConnect(r_en3, r_roadEast, D_EAST).
  475. AutoGraphics(r_roadEast, AutoRoads).
  476.  
  477. define t_streets r_roadSouthEast CreateThing(r_road).
  478. SetupRoomP(r_roadSouthEast, "at a corner in the road", "").
  479. Connect(r_roadEast, r_roadSouthEast, D_SOUTH).
  480. AutoGraphics(r_roadSouthEast, AutoRoads).
  481.  
  482. define t_streets r_roadSouth CreateThing(r_road).
  483. SetupRoomP(r_roadSouth, "at a junction", "The town is to the north.").
  484. Connect(r_roadSouthEast, r_roadSouth, D_WEST).
  485. Connect(r_se2, r_roadSouth, D_SOUTH).
  486. UniConnect(r_sw3, r_roadSouth, D_SOUTH).
  487. AutoGraphics(r_roadSouth, AutoRoads).
  488.  
  489. define t_streets r_roadSouthWest CreateThing(r_road).
  490. SetupRoomP(r_roadSouthWest, "at a corner in the road", "").
  491. Connect(r_roadSouth, r_roadSouthWest, D_WEST).
  492. AutoGraphics(r_roadSouthWest, AutoRoads).
  493.  
  494. define t_streets r_roadWest CreateThing(r_road).
  495. SetupRoomP(r_roadWest, "at a junction", "The town is to the east.").
  496. Connect(r_roadSouthWest, r_roadWest, D_NORTH).
  497. Connect(r_ws3, r_roadWest, D_WEST).
  498. UniConnect(r_wn3, r_roadWest, D_WEST).
  499. AutoGraphics(r_roadWest, AutoRoads).
  500.  
  501. define t_streets r_roadNorthWest CreateThing(r_road).
  502. SetupRoomP(r_roadNorthWest, "at a corner in the road", "").
  503. Connect(r_roadWest, r_roadNorthWest, D_NORTH).
  504. Connect(r_roadNorth, r_roadNorthWest, D_WEST).
  505. AutoGraphics(r_roadNorthWest, AutoRoads).
  506.  
  507. /* a bit of the great outdoors */
  508.  
  509. define t_streets r_path1 CreateThing(r_path).
  510. SetupRoomP(r_path1, "on a north-south pathway", "The town is to the south.").
  511. Connect(r_roadNorth, r_path1, D_NORTH).
  512. AutoGraphics(r_path1, AutoPaths).
  513.  
  514. define t_streets r_path2 CreateThing(r_path).
  515. SetupRoomP(r_path2, "on a north-south pathway",
  516.     "A small trail heads to the east.").
  517. SetThingStatus(r_path2, ts_public);
  518. Connect(r_path1, r_path2, D_NORTH).
  519. AutoGraphics(r_path2, AutoPaths).
  520.  
  521. define t_streets r_path3 CreateThing(r_path).
  522. SetupRoomP(r_path3, "at a dead-end",
  523.     "A large billboard reads: Castle lots for sale - apply with SysAdmin.").
  524. Connect(r_path2, r_path3, D_NORTH).
  525. AutoGraphics(r_path3, AutoPaths).
  526. Sign(r_path3, "board,billboard;large,bill", "",
  527.     "Castle lots for sale - apply with SysAdmin").
  528.  
  529. /* and now a connecting trail */
  530.  
  531. define t_streets r_ewTrail1 CreateThing(r_path).
  532. SetupRoomP(r_ewTrail1, "on an east-west trail", "").
  533. Connect(r_path2, r_ewTrail1, D_EAST).
  534. AutoGraphics(r_ewTrail1, AutoPaths).
  535.  
  536. define t_streets r_ewTrail2 CreateThing(r_path).
  537. SetupRoomP(r_ewTrail2, "on an east-west trail",
  538.     "The trail continues to the east and the west. A line of trees starts "
  539.     "just north of here and continues to the east. You can see the town to "
  540.     "the south, but you can't get there from here.").
  541. Connect(r_ewTrail1, r_ewTrail2, D_EAST).
  542. Scenery(r_ewTrail2, "ground,sky,path,trail,grass.tree,line;line,of.town").
  543. AutoGraphics(r_ewTrail2, AutoPaths).
  544.  
  545. define t_streets r_ewTrail3 CreateThing(r_outdoors).
  546. SetupRoomP(r_ewTrail3, "on an east-west trail",
  547.     "The line of trees continues to the north, and you can see an open field "
  548.     "to the east.").
  549. Scenery(r_ewTrail3, "ground,sky,tree,path,trail,field,trail;line,of").
  550. Connect(r_ewTrail2, r_ewTrail3, D_EAST).
  551. AutoGraphics(r_ewTrail3, AutoPaths).
  552.  
  553. /* here for the next little while is the field with the pear tree */
  554.  
  555. define t_streets r_pearField CreateThing(r_field).
  556. SetupRoomP(r_pearField, "in a field",
  557.     "There is a large pear tree here, full of pears. "
  558.     "A small trail heads west.").
  559. Connect(r_ewTrail3, r_pearField, D_EAST).
  560. AutoGraphics(r_pearField, AutoPaths).
  561. define tp_streets proc fieldSmell()status:
  562.     if It() = nil then
  563.     Print("The air here smells quite fresh and clean!\n");
  564.     succeed
  565.     else
  566.     continue
  567.     fi
  568. corp;
  569. r_pearField@p_oSmellChecker := fieldSmell.
  570.  
  571. define tp_streets o_pearTree CreateThing(nil).
  572. SetupObject(o_pearTree, r_pearField, "tree;large,pear.branch;loaded",
  573.     "The tree is quite large, with many long branches loaded with pears. "
  574.     "It stands by itself in the center of this small field. Many of the "
  575.     "branches come within easy reach.").
  576. o_pearTree@p_oInvisible := true.
  577. o_pearTree@p_oSmellString := "The pear tree smells somewhat woody.".
  578.  
  579. define tp_streets o_pearOnTree CreateThing(nil).
  580. SetupObject(o_pearOnTree, r_pearField, "pear;plump,juicy",
  581.     "The pears on the tree look quite delicious.").
  582. o_pearOnTree@p_oInvisible := true.
  583. o_pearOnTree@p_oEatString := "You should pick a pear from the tree first.".
  584. o_pearOnTree@p_oSmellString := o_pearOnTree@p_oEatString.
  585. o_pearOnTree@p_oTouchString := o_pearOnTree@p_oEatString.
  586.  
  587. /* Special procs for the pears. Note the lack of 'utility', since we
  588.    make the pears belong to whoever sources this file */
  589.  
  590. define tp_streets proc pearDrop(thing pear)status:
  591.     thing carryer, here;
  592.  
  593.     carryer := pear@p_oCarryer;
  594.     ClearThing(pear);
  595.     SPrint(carryer, "The pear drops and is pulped!\n");
  596.     here := Here();
  597.     if CanSee(here, carryer) and not carryer@p_pHidden then
  598.     ABPrint(here, carryer, carryer, FormatName(carryer@p_pName) +
  599.         " drops a pear which sploops.\n");
  600.     else
  601.     ABPrint(here, carryer, carryer, "You hear a smack! sound.\n");
  602.     fi;
  603.     DelElement(carryer@p_pCarrying, pear);
  604.     /* we have just destroyed the pear and already dropped it, we do NOT
  605.        want to continue with normal drop processing */
  606.     succeed
  607. corp;
  608.  
  609. define tp_streets proc pearEat()status:
  610.     thing th, me;
  611.  
  612.     th := It();
  613.     me := Me();
  614.     if th@p_oCreator = me then
  615.     Print("You eat the pear. It was really good.\n");
  616.     if CanSee(Here(), me) and not me@p_pHidden then
  617.         OPrint(FormatName(me@p_pName) + " eats a pear.\n");
  618.     else
  619.         OPrint("You hear some slurping noises.\n");
  620.     fi;
  621.     ClearThing(th);
  622.     DelElement(me@p_pCarrying, th);
  623.     else
  624.     Print("That's not your pear!\n");
  625.     fi;
  626.     /* do NOT continue with normal 'eat' processing */
  627.     succeed
  628. corp;
  629.  
  630. define tp_streets proc pearGive(thing target)status:
  631.     thing me, pear;
  632.  
  633.     me := Me();
  634.     pear := It();
  635.     if pear@p_oCreator = me then
  636.     Print("You fumble when trying to give away the pear, and drop it!\n");
  637.     if CanSee(Here(), me) and not me@p_pHidden then
  638.         OPrint(FormatName(me@p_pName) +
  639.         " drops a pear which sploops.\n");
  640.     else
  641.         OPrint("You hear a smack! sound.\n");
  642.     fi;
  643.     ClearThing(pear);
  644.     DelElement(me@p_pCarrying, pear);
  645.     else
  646.     Print("That's not your pear!\n");
  647.     fi;
  648.     /* the give never works */
  649.     fail
  650. corp;
  651.  
  652. define tp_streets proc pearPutIn(thing pear, container)status:
  653.     string containerName;
  654.  
  655.     containerName := FormatName(container@p_oName);
  656.     Print("You drop the pear into the " + containerName +
  657.     ". Unfortunately, the pear doesn't survive the dropping - it is "
  658.     "squished. You shake out the pieces and clean the mess out of the " +
  659.     containerName + ".\n");
  660.     ClearThing(pear);
  661.     DelElement(Me()@p_pCarrying, pear);
  662.     succeed
  663. corp;
  664.  
  665. define tp_streets o_pearInHand CreateThing(nil).
  666. o_pearInHand@p_oName := "pear;plump,juicy".
  667. o_pearInHand@p_oDesc := "The pear looks exceedingly delicious!".
  668. o_pearInHand@p_oEatChecker := pearEat.
  669. o_pearInHand@p_oDropChecker := pearDrop.
  670. o_pearInHand@p_oPutMeInChecker := pearPutIn.
  671. o_pearInHand@p_oSmellString := "The pear smells like a pear.".
  672. o_pearInHand@p_oTouchString := "Surprise! The pear feels like a pear.".
  673. SetThingStatus(o_pearInHand, ts_public).
  674.  
  675. define tp_streets proc pearGet(thing th)status:
  676.     thing me;
  677.  
  678.     me := Me();
  679.     if FindChildOnList(me@p_pCarrying, o_pearInHand) then
  680.     Print("Don't be greedy! You already have a pear.\n");
  681.     else
  682.     /* will be owned by the real player */
  683.     th := CreateThing(o_pearInHand);
  684.     th@p_oCreator := me;
  685.     SetThingStatus(th, ts_public);
  686.     if CarryItem(th) then
  687.         /* This is put directly on the individual pears, so that it can
  688.            be removed in 'questPearGive'. */
  689.         th@p_oGiveChecker := pearGive;
  690.         Print("You pick a pear from the tree.\n");
  691.         /* assume it is not dark */
  692.         if not me@p_pHidden then
  693.         OPrint(FormatName(me@p_pName) +
  694.                " picks a pear from the tree.\n");
  695.         fi;
  696.     else
  697.         ClearThing(th);
  698.     fi;
  699.     fi;
  700.     /* do not want to continue with normal get processing */
  701.     succeed
  702. corp;
  703.  
  704. o_pearOnTree@p_oGetChecker := pearGet.
  705.  
  706. define tp_streets proc questPearDesc()string:
  707.  
  708.     "Bring me two pears."
  709. corp;
  710.  
  711. define tp_streets proc questPearGive()status:
  712.     thing pear;
  713.  
  714.     pear := It();
  715.     if Parent(pear) = o_pearInHand then
  716.     /* make it not sploop */
  717.     if QuestThing@p_QuestActive ~= questPearGive then
  718.         QuestThing@p_QuestState := 0;
  719.         QuestThing@p_QuestActive := questPearGive;
  720.     fi;
  721.     pear -- p_oGiveChecker;
  722.     GiveToQuestor("plump juicy pear");
  723.     if QuestThing@p_QuestState = 0 then
  724.         QuestThing@p_QuestState := 1;
  725.         fail
  726.     else
  727.         succeed
  728.     fi
  729.     elif pear@p_oName = "pear;plump,juicy" then
  730.     QuestThing@p_QuestState := 0;
  731.     GiveToQuestor("plump juicy pear");
  732.     SPrint(TrueMe(), "Questor is not impressed.\n");
  733.     fail
  734.     else
  735.     continue
  736.     fi
  737. corp;
  738.  
  739. define tp_streets proc questPearHint()string:
  740.  
  741.     "Perhaps you need help from a friendly flower."
  742. corp;
  743.  
  744. QuestGive("Pear", questPearDesc, questPearGive, questPearHint).
  745.  
  746. define tp_streets proc pearTreeGet(thing th)status:
  747.     Print("The tree is far too large for you to carry, and in any event, "
  748.         "it is securely rooted to the ground.\n");
  749.     if Me()@p_pHidden then
  750.     OPrint("The tree shakes slightly.\n");
  751.     else
  752.     OPrint(FormatName(Me()@p_pName) +
  753.            " seems to be embracing the tree.\n");
  754.     fi;
  755.     succeed
  756. corp;
  757.  
  758. o_pearTree@p_oGetChecker := pearTreeGet.
  759.  
  760. unuse tp_streets
  761.